Restart remote BizTalk server group host instances through BizTalk powershell provider script is not working
I have used below code to get host instances and restart its working on power shell command prompt but not working
through script ,it getting local server host instances not remote biztalk server group
Enter-pssession -computername 16 -configurationname microsoft.powershell32
Remove-PSSnapin -Name BizTalkfactory.PowerShell.Extensions;
Add-PSSnapin -Name BizTalkfactory.PowerShell.Extensions;
set-location Biztalk:
set-location 'Platform Settings';
set-location 'Host Instances'
write-host "Getting all host instances from 16 machine"
Get-ChildItem
October 11th, 2013 12:30pm
Can you try the following (normal PS, nothing to do with the BizTalk provider):
Please verify first, that computer 16 don't have any other Services than your Host Instances starting with the "BTS" prefix :-)
Morten la Cour
October 11th, 2013 12:56pm
I have to restart based on the condition like I have to restart only the host instances stopped .
Get-ChildItem |Where-Object { $_.ServiceState -eq 'Stopped' } |Start-HostInstance
October 11th, 2013 1:37pm
Try following script...It will you state of the host instance...
Invoke-Command -Session $s -ScriptBlock { param($filter) $HostInstance = get-wmiobject MSBTS_HostInstance -namespace 'root\MicrosoftBizTalkServer' -filter $filter
$HostInstanceState = $HostInstance.GetState().State
($HostInstanceState # 1=Stopped, 2=Start pending, 3=Stop pending, 4=Running, 8=Unknown )
$HostInstance.start() (for restarting stooped ones)
i think that helps.let me know if you need more..
Thanks.
-
Edited by
bobby us
Monday, October 14, 2013 2:34 AM
October 14th, 2013 5:33am
This script is only execute on biztalk installed machine but my requirement is configure all scripts in application server.Biztalk server is not installed on this application server.
October 14th, 2013 7:27pm
what we are doing is we are using jenikns job to restart host instances using the above script.
Yes you can restart from applciation server.For that you need estabilsh remote session and inside the session you will run this scripts.It will work..
please drop me your email ID i can send you comeplete script.
Thanks.
October 15th, 2013 12:33am
Thanks Bobby.
My mail id is :kapil.it24@gmail.com
October 15th, 2013 9:17am
Hi Bobby,
Could you please send me the script
Thanks,
Kapil.
-
Edited by
kapil kumar velpuri
Wednesday, October 16, 2013 7:10 AM
October 16th, 2013 10:08am
Sorry For the late reply...i sent you just now..
October 16th, 2013 11:33pm
My issue is resolved:
Solution:
I have used invoke-Command to run the Powershell script in a remote session on the BizTalk server. The script could create the PSDrive, browse it
and create items as expected.
-
Proposed as answer by
M.R.Ashwin PrabhuMVP
Wednesday, November 06, 2013 2:46 PM
November 6th, 2013 4:37pm
HI kapil,
Could you share me that invoke_command pls..
February 11th, 2015 2:42pm